import request from '@/request/index'
import { Card } from './type'

enum URL {
  CARD = 'bill/card',
  BUDGET = 'bill/budget'
}

export const getCardList = () => request.get<Card[]>(URL.CARD) // 获取卡包列表
export const saveCard = (data: any) => request.post(URL.CARD, data)  // 保存卡包
export const getYearBudget = () => request.get(URL.BUDGET)  // 获取年度预算
export const saveYearBudget = (data: any) => request.post(URL.BUDGET, data) // 保存年度预算
export const getCardRecord = (id: number) => request.get(URL.CARD + `/record/${id}`)  // 获取卡记录
